%
%
%
function [] = printFigures( dataName, vertices, figure )

dir = dataName;
mkdir( dir );
data = load( ['temporal-fields-' dataName '.mat'] );
strainTemporal = data.strainTemporal;
bendingTemporal = data.bendingTemporal;

num_vert = size(strainTemporal, 1);
max_strain = 0.0;
for i = 1 : num_vert
    new_max_strain = norm( strainTemporal(i, :), Inf );
    if( new_max_strain > max_strain )
        max_strain = new_max_strain;
    end % if
end % for
if (max_strain ~= 0)
    strainTemporal = strainTemporal ./ max_strain;
end % if

max_bending = 0.0;
for i = 1 : num_vert
    new_max_bending = norm( bendingTemporal(i,:), Inf );
    if(new_max_bending > max_bending )
        max_bending = new_max_bending;
    end % if
end % for
if(max_bending ~= 0)
    bendingTemporal = bendingTemporal ./ max_bending;
end % if


n = size( vertices, 2 );
for i = 1:n
    vertex_id = vertices(i);
    if (figure) 
        vertexFigure( vertex_id, strainTemporal, bendingTemporal );
    else
        vertexHist( vertex_id, strainTemporal, bendingTemporal );
    end % if
end % for

end % function

